UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'CwjUfcUTOj/sCg2AWvJ85t5oVrMO4JA94IElwcBsntQ='
WHERE
key_id = '57b83285af3bae175b20d0b0eeb99a3eef37e96d3310d4ab4c0af969041c88b4'
AND (
token = 'CwjUfcUTOj/sCg2AWvJ85t5oVrMO4JA94IElwcBsntQ='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)