UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '3JQTuELTo9PYOmMuqA/7XN7ohkNqNWlmEOzUI4ogxgU='
WHERE
key_id = 'ea232a8fc4f62c9e021e08762cd988985e6f8e0b9f49cdb35d63910ee11f9d41'
AND (
token = '3JQTuELTo9PYOmMuqA/7XN7ohkNqNWlmEOzUI4ogxgU='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)