UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'pcAsrjWA+vQFeZNyGx5c1P2/AgMn8UpIyzM7zqlZjS0=' 
WHERE 
  key_id = '8f607cea227c1821fc0271be8049f6b6f926a3f003486d373f0121b276461a1e' 
  AND (
    token = 'pcAsrjWA+vQFeZNyGx5c1P2/AgMn8UpIyzM7zqlZjS0=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00037