UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'oDTCoDMpO2fsF+J+bPSVbhOF5k829VP2hmpfAS32FBU='
WHERE
key_id = '22e5c68a64ebfe662dd3d8a6389e19b3bf6b5eca2397247d7ea325b88e721bec'
AND (
token = 'oDTCoDMpO2fsF+J+bPSVbhOF5k829VP2hmpfAS32FBU='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)