UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '2RITkxT75Jj3t9qhMVu1EvybyYEaEuCQ5rKnj4b61GY='
WHERE
key_id = '0c00ff14b3a720d95ea1125b76db18ff24a2d99b4427ac7ec2c29f71146f8146'
AND (
token = '2RITkxT75Jj3t9qhMVu1EvybyYEaEuCQ5rKnj4b61GY='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)