UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '4rptEyMl7rY7tIwqZ7jNzxlIr/y7jR6NsnMNJX24w00='
WHERE
key_id = '3ee1948579b11b052b977935313154aafe30a349a782ea30ba0c80892694be38'
AND (
token = '4rptEyMl7rY7tIwqZ7jNzxlIr/y7jR6NsnMNJX24w00='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)