UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'a/e6RilNRnOMryUCHOFTXfxifDR5S/2ChwN/Q+rsGqc='
WHERE
key_id = '0965f733bb11788e798f4f79a4ce93609251b52bdc9fc27c48ab41248ab858da'
AND (
token = 'a/e6RilNRnOMryUCHOFTXfxifDR5S/2ChwN/Q+rsGqc='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)