UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'jUMIZSN4RpJpUBQUEt+QrN82yDOFvW4Egr8OQIlrEAw='
WHERE
key_id = 'e7e6e006c8ab686953c09994348d0beb3c2f811a89ceba417adbe2cc99755de1'
AND (
token = 'jUMIZSN4RpJpUBQUEt+QrN82yDOFvW4Egr8OQIlrEAw='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)