UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'iilCjdr1SCmPg3TSgu+iLxtEEKpkgwUn+Q9RzItgoLo=' 
WHERE 
  key_id = '497c6d0e0cf58c7bc1d758cd8ceeb839fb00ae0d7cef9bc9bb9d9a3746234a2f' 
  AND (
    token = 'iilCjdr1SCmPg3TSgu+iLxtEEKpkgwUn+Q9RzItgoLo=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00039