UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '1+GCvqDxb0G0vqHAL9zhTI3EcTHfcgeQyIdgtw4T544='
WHERE
key_id = '7ebc7cb7c16fe04e39a206ff0ea1733efcf0e7a519aebb1b7cba2c3ce3259a2b'
AND (
token = '1+GCvqDxb0G0vqHAL9zhTI3EcTHfcgeQyIdgtw4T544='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)