UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'PQcEmZbqSp2XW7PsYDtzdasqd98psTQ0AAogcNA/zuY=' 
WHERE 
  key_id = '2248e4786606434bdb33674cb97b2aa9702e88788589b921b25f0161b38d14bc' 
  AND (
    token = 'PQcEmZbqSp2XW7PsYDtzdasqd98psTQ0AAogcNA/zuY=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00032