UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = '9yDKwLKUf4QG62nhjrsBod+lvgbsVGpddDVWHvSBPck=' 
WHERE 
  key_id = '3a1af3b16b4fb317c39a2ed8fd9603d496ba838565ae8530cf1782fc94d09640' 
  AND (
    token = '9yDKwLKUf4QG62nhjrsBod+lvgbsVGpddDVWHvSBPck=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00019