UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'eTdKM4R9izfndWQa85aI5sNszR5QhshYzz4trBsFF9Y='
WHERE
key_id = '3a791d043720a368935973e70bae8bd479c2857618290a0ee71123db0e16c4b3'
AND (
token = 'eTdKM4R9izfndWQa85aI5sNszR5QhshYzz4trBsFF9Y='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)