UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'kRAdw1ueOvtwOXqKEZSMh05/x/SN25g4YfIcx69fGGQ='
WHERE
key_id = 'eb7a61c22f7d6fc48c45472f6fb0b13585866126f469c0fea5a0815595ae4ccf'
AND (
token = 'kRAdw1ueOvtwOXqKEZSMh05/x/SN25g4YfIcx69fGGQ='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)