UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'uPfXWfQ6tZ5WHXNiid9tBeZ2aRr1QY+0i226MU9s1SE=' 
WHERE 
  key_id = 'a6d707c3fa0a1dcb5dd2cece68e3e4598537d55557522576e48a675ddaacb1ce' 
  AND (
    token = 'uPfXWfQ6tZ5WHXNiid9tBeZ2aRr1QY+0i226MU9s1SE=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00026