UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'TSaejQ44qMeBu/DJR5K3JLjRR8OakxP9Hfyc9dPQEFU=' 
WHERE 
  key_id = '49cc0ba02ead2e5f00bc8bcfb4c257e4f9472fb6d3bacf8c7d955dfdc2445797' 
  AND (
    token = 'TSaejQ44qMeBu/DJR5K3JLjRR8OakxP9Hfyc9dPQEFU=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00041