UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'mKxhem5uQRHI9YahRRLQ23e8WFODsJX2RUUqHVQYP4c=' 
WHERE 
  key_id = '1900efb9fd981687acd1d6ac626828457c8d993ec5f6515c736306bb7be6204f' 
  AND (
    token = 'mKxhem5uQRHI9YahRRLQ23e8WFODsJX2RUUqHVQYP4c=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00038