UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'DYTtiiVmf9pBDhUR+sOo71FRiPph8LXx+0c1AzXv30Y='
WHERE
key_id = '61328e5e8da2ae73de4faa903f3d0659f7ae1848bf23390333145d901a3189ca'
AND (
token = 'DYTtiiVmf9pBDhUR+sOo71FRiPph8LXx+0c1AzXv30Y='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)