UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'n0SOLaP1lejBerpVSeTOo7CHtVBmbCs+VXYNZFI2DQw='
WHERE
key_id = 'dd22e24386fb650b47e1b0d9ca387fe51c8ff541b8e8a146fa40c7be14114da7'
AND (
token = 'n0SOLaP1lejBerpVSeTOo7CHtVBmbCs+VXYNZFI2DQw='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)