UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'UM4g+OIJbxbjn5z9clr9Da4uP/EYu7DlnjwFEpL0HE8='
WHERE
key_id = 'f65db5883b93cd71aa6d961216fbc209800be984fc6f1021be9687f4680f4e0e'
AND (
token = 'UM4g+OIJbxbjn5z9clr9Da4uP/EYu7DlnjwFEpL0HE8='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)