UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = '82ydeUDLMayp4BWp7oX6TBiLUAkP+SEERoe4gBwBCiI=' 
WHERE 
  key_id = '05446e8e59922009c10fd6b568511927509f777edc651111083c97522fc15596' 
  AND (
    token = '82ydeUDLMayp4BWp7oX6TBiLUAkP+SEERoe4gBwBCiI=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00038