UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'ksGhccp20SRL+OszKiSx4EIS/n3a/BUzIlnFmlZWXNg=' 
WHERE 
  key_id = '3d54b0566de90ab93f8ee010628c52adc9803a4205a3ae75e9c2744d7dfb8a14' 
  AND (
    token = 'ksGhccp20SRL+OszKiSx4EIS/n3a/BUzIlnFmlZWXNg=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00029