UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'pxweC1fDGyGhq3wNJBCEUyFNb0llOIOFPzNbSYR4TGY='
WHERE
key_id = 'e464b8bd4b0b54fc23566664acfe2b62b1b586fafb48c058486cbe9d1345ce53'
AND (
token = 'pxweC1fDGyGhq3wNJBCEUyFNb0llOIOFPzNbSYR4TGY='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)