UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'fHM55pCTOoHucO9S3yniXpf2wpM4Ux5JejT6kl2k9h0='
WHERE
key_id = '5555fcdb1d1b47f9966b7d2028b8e080953a929156969ca0cbc223f3d7e14998'
AND (
token = 'fHM55pCTOoHucO9S3yniXpf2wpM4Ux5JejT6kl2k9h0='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)