UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'AR6PpLZL9f7R3zSk3kdLvB2vcChv5D02foUDmyv9iKI='
WHERE
key_id = '998611c143760fcea86f181041d84a725298d8e549d89b0b08e195f0c0e6e334'
AND (
token = 'AR6PpLZL9f7R3zSk3kdLvB2vcChv5D02foUDmyv9iKI='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)