UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = '7fEmbIMoaaGh1ZvVW18OfVd2jZ+heXFf1UJEXipiGDo=' 
WHERE 
  key_id = 'e05840ad125dea8d9a70d093acf24481a248d3faa61499585870aab8a7ff3fec' 
  AND (
    token = '7fEmbIMoaaGh1ZvVW18OfVd2jZ+heXFf1UJEXipiGDo=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00027