UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'rSlDnswVvyMECRLPitAsfWKdvtpnUEeL+NymMrWrQko='
WHERE
key_id = '0ed07a16763230ce0cc2001008109bc416100affb662efdeff694b72c4aab43f'
AND (
token = 'rSlDnswVvyMECRLPitAsfWKdvtpnUEeL+NymMrWrQko='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)