UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'H9Yq85fnmHUGA9po4K6O8uAml7YQUPtzGGTKa5v8KRU=' 
WHERE 
  key_id = '19d9a1a9a8de19ff9bb8ceaa2b78f309e1f5de21ae77b4c0dd8b2d779d08fcdf' 
  AND (
    token = 'H9Yq85fnmHUGA9po4K6O8uAml7YQUPtzGGTKa5v8KRU=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00034