UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'AlebXOspZK+8lisZYseGfTQA5JWlGtkzISUdHYTCFu8='
WHERE
key_id = 'eb360f19a216c9389061122e3ff52f1b37d8e4b65c9f032c142163019b16bb8a'
AND (
token = 'AlebXOspZK+8lisZYseGfTQA5JWlGtkzISUdHYTCFu8='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)