UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'np78dQlzsuxmLVSpGzy95EmmbF1cofCWMK9Ib4/nJic=' 
WHERE 
  key_id = 'ba3f9f54a10898955ab6924847a7d80c84912032e92f7b181e78ed5f372cc772' 
  AND (
    token = 'np78dQlzsuxmLVSpGzy95EmmbF1cofCWMK9Ib4/nJic=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00031