UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'ShLkU/Gg1hev5CIWt8R0sDLHl24nybwg47EbwmDpTcg='
WHERE
key_id = '823999733092a64c97ecbe481866b0c485beb7abeb7e17c81f4d8b3277697a86'
AND (
token = 'ShLkU/Gg1hev5CIWt8R0sDLHl24nybwg47EbwmDpTcg='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)