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