UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'JHRsl5YDSRNhkAGo76wvr1TjzqYZkiOVOECNMi4diqA=' 
WHERE 
  key_id = '8a88dd9f1e2f408921fdcb09e2029404f3871882a5d1fac4f5cfa4e954a922ab' 
  AND (
    token = 'JHRsl5YDSRNhkAGo76wvr1TjzqYZkiOVOECNMi4diqA=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00028