UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'hin1+N1wfbQ5YIvJY4JU3RCw0tKGLg3uTXGqiXPkHVE=' 
WHERE 
  key_id = 'fd1d8f0c379d309aed36c9b1ee70190ea0b1800b7a181f7b6aa3b94cdbe3f0b5' 
  AND (
    token = 'hin1+N1wfbQ5YIvJY4JU3RCw0tKGLg3uTXGqiXPkHVE=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00028