UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'xrUgRYOn0KSgxsk5qTTc2fDqzjIkFzAb9ApOfQYwDS8='
WHERE
key_id = '45439043919ab463c98f576f4799a10856c5ea9eb37972f0f01ac1ddf9434955'
AND (
token = 'xrUgRYOn0KSgxsk5qTTc2fDqzjIkFzAb9ApOfQYwDS8='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)