UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'Llp7VJz04fTaiztb+5hLA5bghzEMsQtsPMFP/pVXdmg=' 
WHERE 
  key_id = '2371f9f784b9b12293b8cf3ac0ccc490805690f4b21ec7a74095c42a45f5ec97' 
  AND (
    token = 'Llp7VJz04fTaiztb+5hLA5bghzEMsQtsPMFP/pVXdmg=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00041