UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = '+n0e37WWgg4z4oWQ9RU3VDjreel9vd4Xal2nUH/fYAw=' 
WHERE 
  key_id = 'd22606052b05b2af14ea1c551e48a1a9d68d7cd0ef534afc962c91566c5302b4' 
  AND (
    token = '+n0e37WWgg4z4oWQ9RU3VDjreel9vd4Xal2nUH/fYAw=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00038