UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'F2qHI1mScCqnFKQ+VtX+J3kG5iCgUa8EXwhxjsgCywQ='
WHERE
key_id = '7de1e27b44997d323e7f17fb40598054dc9b6a2a9726611d86a7a034681dee3b'
AND (
token = 'F2qHI1mScCqnFKQ+VtX+J3kG5iCgUa8EXwhxjsgCywQ='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)