UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'kdrkey0jV3EXRLFGbU/3/5tUXJeUJ8kqy9P2WZANezQ=' 
WHERE 
  key_id = 'f28cd97cfaf6fd6373a6fc1360e27a728cbe6e635107e7b26e15da7900aff147' 
  AND (
    token = 'kdrkey0jV3EXRLFGbU/3/5tUXJeUJ8kqy9P2WZANezQ=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00033