UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'B/2t3d8lIr7n/7mJLGpKRe8V38l0QY8AgP+7ZUcrNi0='
WHERE
key_id = '5e7cf62b0c0bc2d63ae456ea64a1a7abe9f5eddf9afdd048f0cfb305196cc213'
AND (
token = 'B/2t3d8lIr7n/7mJLGpKRe8V38l0QY8AgP+7ZUcrNi0='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)