UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '+d6kmBqaWG0Gitw+GsSuFpoZPum8YluKsyVYQ4/3OQc='
WHERE
key_id = '4b200f20bf29535569cff544d880a0da99e89e905ae7a7d9f20497985ae631f6'
AND (
token = '+d6kmBqaWG0Gitw+GsSuFpoZPum8YluKsyVYQ4/3OQc='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)