UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = '64dhnbDCdKCm82YXGSwy+Zx8CEoHtESQzgAEPo3S3SU=' 
WHERE 
  key_id = '22d7d4af147104efd2201ef08d163f66f1d68968ccf2041ea7bea51a6b33c0bc' 
  AND (
    token = '64dhnbDCdKCm82YXGSwy+Zx8CEoHtESQzgAEPo3S3SU=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00029