UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'qdnHWKjSpTpQBdum7u5G52LTMCi1mhwm43AfVGlRdrE='
WHERE
key_id = '4db04a7adb69832d8b140804fef03b740208eb7db71bf165515b4a94aa62433c'
AND (
token = 'qdnHWKjSpTpQBdum7u5G52LTMCi1mhwm43AfVGlRdrE='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)